home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / LunarLander.swf / scripts / frame_5 / PlaceObject2_98_4 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2006-06-13  |  1.3 KB  |  51 lines

  1. onClipEvent(enterFrame){
  2.    if(gen != false)
  3.    {
  4.       if(Math.random() < 0.1)
  5.       {
  6.          _root.level = _root.level + 1;
  7.          duplicateMovieClip(this,"fire" + _root.level,16384 + _root.level);
  8.          f = eval("_root.fire" + _root.level);
  9.          f._x = 100 + Math.random() * (_root.width - 200);
  10.          f._y = 100 + Math.random() * (_root.height - 200);
  11.          f.gen = false;
  12.          f.parent = true;
  13.       }
  14.    }
  15.    else if(parent)
  16.    {
  17.       _Y = _Y - upvel;
  18.       timer++;
  19.       if(uptime < timer)
  20.       {
  21.          i = 0;
  22.          while(i < 6.283185307179586)
  23.          {
  24.             _root.level = _root.level + 1;
  25.             duplicateMovieClip(this,"fire" + _root.level,16384 + _root.level);
  26.             f = eval("_root.fire" + _root.level);
  27.             f.xs = Math.sin(i) * initfallvel;
  28.             f.ys = Math.cos(i) * initfallvel;
  29.             f.trans = new Object();
  30.             f.trans.ra = trans.ra;
  31.             f.trans.ga = trans.ga;
  32.             f.trans.ba = trans.ba;
  33.             f.gen = false;
  34.             f.parent = false;
  35.             i += 0.3141592653589793;
  36.          }
  37.          removeMovieClip(this);
  38.       }
  39.    }
  40.    else
  41.    {
  42.       _X = _X + xs;
  43.       _Y = _Y + ys;
  44.       _alpha = _alpha - 5;
  45.       if(_alpha < 0)
  46.       {
  47.          removeMovieClip(this);
  48.       }
  49.    }
  50. }
  51.